home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / author.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-24  |  2.2 KB  |  105 lines

  1. #include <stdio.h>
  2. #include <dir.h>
  3. #include <dos.h>
  4. #include <string.h>
  5. #include <time.h>
  6. #define TUTOR        1
  7. #define STANDALONE    1
  8. #define ASCII_TYPE     0
  9. #define tprintf printf
  10. #define NULLCHAR ((char *) 0)
  11. #define NULLFILE ((FILE *) 0)
  12. #define READ_TEXT "rt"
  13.  
  14. char *Info, *Tutor, *News, *Hostname;
  15.  
  16. pwait (void * i) {}
  17.  
  18. tputs (char *str)
  19. {
  20.     fputs (str, stdout);
  21. }
  22.  
  23. tputc (char c)
  24. {
  25.     putchar (c);
  26. }
  27.  
  28. void
  29. mygets (buf, size, here)
  30. char *buf;
  31. int size;
  32. struct world *here;
  33. {
  34.     fgets(buf, size, stdin);
  35. }
  36.  
  37. rdaemon (FILE *out, char *from, char *to, char *subject, char msgtype)
  38. {
  39.     puts ("------------------------------------------------------");
  40.     puts ("On a TNOS system, a mail message WOULD have been sent\nat this point:\n");
  41.     printf ("  From: %s\n  To: %s\n  Subject: %s\n  X-BBS-Msg-Type: %c\n", from, to, subject, msgtype);
  42.     puts ("------------------------------------------------------");
  43. }
  44.  
  45. /* replace terminating end of line marker(s) with null */
  46. void
  47. rip(s)
  48. register char *s;
  49. {
  50.     register char *cp;
  51.  
  52.     if((cp = strchr(s,'\n')) != NULLCHAR)
  53.         *cp = '\0';
  54. }
  55.  
  56. sendfile (FILE *fp)
  57. {
  58. int c;
  59.     while((c = getc(fp)) != EOF){
  60.         if(putchar((char)c) == -1)
  61.             break;
  62.     }
  63. }
  64.  
  65. #include "tutor.c"
  66. #define DEMO
  67. #include "color.c"
  68.  
  69. void
  70. main(int argc, char *argv[])
  71. {
  72. char selection[10];
  73. int select;
  74. char *call;
  75.  
  76.     Info = "INFO";
  77.     Tutor = "TUTOR";
  78.     News = "NEWS";
  79.     Hostname = "test.ampr.org";
  80.     call = "N4WOW";
  81.  
  82.     puts ("\nThe TNOS Information Server Authoring System assumes that you have\nthe following sub-directories in your current directory:\n");
  83.     puts ("   INFO, TUTOR, NEWS\n\nIf these do not exist in your current directory, don't blame me!    KO4KS\n");
  84.     for ( ; ; )    {
  85.         puts ("\nPick an information server...\n");
  86.         puts ("     0 - Exit the Authoring System");
  87.         puts ("     1 - Learning Center (TUTOR)");
  88.         puts ("     2 - Information Center (INFO)");
  89.         puts ("     3 - News Center (NEWS)");
  90.         do    {
  91.             puts ("\nEnter Selection:");
  92.             gets (selection);
  93.             select = atoi (selection);
  94.             if (!select)
  95.                 break;
  96.             if (select > 3)
  97.                 puts ("Invalid number... select 0 - 3!\007");
  98.         } while (select > 3);
  99.         if (!select)
  100.             break;
  101.         tutorserv (call, select - 1, 1, 1);
  102.         puts ("\n\n");
  103.     }
  104. }
  105.